<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/system/admin/header.jsp" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <base href="<%=basePath%>">
    <meta charset="utf-8"/><!-- jsp文件头和头部 -->
    <%@ include file="/WEB-INF/jsp/system/admin/top.jsp" %>
</head>
<body>
<form class="layui-form" action="${objectNameLower}/${r"${msg }"}.do" name="Form" id="Form" method="post">
    <input type="hidden" name="${objectNameUpper}_ID" id="${objectNameUpper}_ID"
           value="${r"${pd."}${objectNameUpper}_ID${r"}"}"/>
    <div id="zhongxin">
    <#list fieldList as var>
        <#if var[3] == "是">
            <#if var[1] == 'Date'>
                <div class="layui-form-item">
                    <label class="layui-form-label">${var[2] }</label>
                    <div class="layui-input-block">
                        <input type="number" name="${var[0] }" id="${var[0] }" value="${r"${pd."}${var[0] }${r"}"}"
                               maxlength="32" placeholder="这里输入${var[2] }" title="${var[2] }" class="layui-input"/>
                    </div>
                </div>

            <#elseif var[1] == 'Integer'>

                <div class="layui-form-item">
                    <label class="layui-form-label">${var[2] }</label>
                    <div class="layui-input-block">
                        <input type="number" name="${var[0] }" id="${var[0] }" value="${r"${pd."}${var[0] }${r"}"}"
                               maxlength="32" placeholder="这里输入${var[2] }" title="${var[2] }" class="layui-input"/>
                    </div>
                </div>

            <#else>
                <div class="layui-form-item">
                    <label class="layui-form-label">${var[2] }</label>
                    <div class="layui-input-block">
                        <input type="text" name="${var[0] }" id="${var[0] }" value="${r"${pd."}${var[0] }${r"}"}"
                               maxlength="32" placeholder="这里输入${var[2] }" title="${var[2] }" class="layui-input"/>
                    </div>
                </div>
            </#if>
        </#if>
    </#list>

        <button class="layui-btn layui-btn-radius" onclick="save()">确定</button>
        <button class="layui-btn layui-btn-danger layui-btn-radius" onclick="cancle()">取消</button>
    </div>
    <div id="zhongxin2" class="center" style="display:none"><br/><br/><br/><br/><br/><img
            src="static/images/jiazai.gif"/><br/><h4 class="lighter block green">提交中...</h4></div>
</form>
<script type="text/javascript">
    //取消
    function cancle() {
        var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
        parent.layer.close(index);
        //parent.layer.close(index);
    }

    //保存
    function save() {
    <#list fieldList as var>
        <#if var[3] == "是">
            if ($("#${var[0] }").val() == "") {
                $("#${var[0] }").tips({
                    side: 3,
                    msg: '请输入${var[2] }',
                    bg: '#AE81FF',
                    time: 2
                });
                $("#${var[0] }").focus();
                return false;
            }
        </#if>
    </#list>
        $("#Form").submit();
        $("#zhongxin").hide();
        $("#zhongxin2").show();
        var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
        parent.layer.close(index);
    }
</script>
</body>
</html>